package com.yanqu.road.entity.activity.fellingtrees.config;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.property.Property;
import com.yanqu.road.utils.property.PropertyHelper;
import com.yanqu.road.utils.string.StringUtils;

import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_ftrees_elixir")
public class FellingTreesElixirConfig {

    @FieldTypeAnnotation(desc = "活动id", select = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "仙丹ID")
    private int id;
    @FieldTypeAnnotation(desc = "仙丹图标")
    private String icon;
    @FieldTypeAnnotation(desc = "仙丹品质")
    private int quality;
    @FieldTypeAnnotation(desc = "效果类型")
    private int type;
    @FieldTypeAnnotation(desc = "效果参数")
    private String param;
    @FieldTypeAnnotation(desc = "持续次数")
    private int times;
    @FieldTypeAnnotation(desc = "所需体力")
    private int energy;
    @FieldTypeAnnotation(desc = "所需药材")
    private String materials;

    private List<Long> paramList;
    private Property materialsProp;

    public void init() {
        paramList = StringUtils.stringToLongList(param, "\\|");
        materialsProp = PropertyHelper.parseStringToProperty(materials);
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public int getQuality() {
        return quality;
    }

    public void setQuality(int quality) {
        this.quality = quality;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }

    public int getTimes() {
        return times;
    }

    public void setTimes(int times) {
        this.times = times;
    }

    public int getEnergy() {
        return energy;
    }

    public void setEnergy(int energy) {
        this.energy = energy;
    }

    public String getMaterials() {
        return materials;
    }

    public void setMaterials(String materials) {
        this.materials = materials;
    }

    public List<Long> getParamList() {
        return paramList;
    }

    public void setParamList(List<Long> paramList) {
        this.paramList = paramList;
    }

    public Property getMaterialsProp() {
        return materialsProp;
    }

    public void setMaterialsProp(Property materialsProp) {
        this.materialsProp = materialsProp;
    }
}
